package edu.java.water.tool;

import com.github.wxpay.sdk.WXPayConfig;

import java.io.*;

public class MyWXConfig implements WXPayConfig {
    private byte[] certData;

    public MyWXConfig() throws Exception {
//        String certPath = "/path/to/apiclient_cert.p12";
//        File file = new File(certPath);
//        InputStream certStream = new FileInputStream(file);
//        this.certData = new byte[(int) file.length()];
//        certStream.read(this.certData);
//        certStream.close();
    }
    @Override
    public String getAppID() {
        return "wx624d215f632e207a";
    }

    @Override
    public String getMchID() {
        return "1609033983";
    }

    @Override
    public String getKey() {
        return "xmszxxxxkjyxgs91350211MA31FYK648";
    }

    @Override
    public InputStream getCertStream() {
        ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
        return certBis;
    }

    @Override
    public int getHttpConnectTimeoutMs() {
        return 8000;
    }

    @Override
    public int getHttpReadTimeoutMs() {
        return 10000;
    }
}
